﻿//取消按钮方法
function Cancel() {
    location.href = "/Role/Index";
}

//保存按钮方法
function Save() {
    if (!$("#roleForm").valid()) {
        return;
    }
//    var nodes = zTreeObj.getCheckedNodes(true);
//    var Entitle = "";
//    for (var i = 0; i < nodes.length; i++) {
//        Entitle += nodes[i].Id + ";";
//    }

    $.post("/Role/AddRole", {
        RoleName: $("#RoleName").val(),
        Description: $("#Description").val()
        //MenuId: Entitle
    }, function (data) {
        if (data == "True") {
            alert(SaveSuccess);
            window.location.href = "/Role/Index";
        }
        else {
            alert(SaveFail);
        }
    });
}
